class  MyThread1 implements Runnable {
    @Override
    public void run() {
        while (true){
            System.out.println("hello");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
public class ThreadDemo2 {
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new MyThread1();
        Thread thread = new Thread(runnable);
        thread.start();
        while (true){
            System.out.println("mian");
            Thread.sleep(1000);
        }
    }



}
